package com.bite.blog.model;

import com.bite.blog.utils.DateUtils;
import lombok.Data;

import java.util.Date;

@Data
public class BlogInfo {
    private Integer id;
    private String title;
    private String content;
    private Integer userId;
    private boolean isLoginUser;
    private Integer deleteFlag;
    private Date createTime;
    private Date updateTime;

    /*
    *前端$(".content .date").text(blog.createTime)这个语句其实是调用后端的这个方法
    * 这个方法格式化日期格式
     */
    public String getCreateTime(){
        return DateUtils.dateFormat(createTime);
    }
}
